﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FluffyUnderware.Curvy.Controllers;
using FluffyUnderware.Curvy;

namespace Yoozoo.Gameplay.City.AI
{
    public class NPCCustomPath : ConnectedControlPointsSelector
    {
		public override CurvySplineSegment SelectConnectedControlPoint(SplineController caller, CurvyConnection connection, CurvySplineSegment currentControlPoint)
		{
			bool isOpen = false;
			CurvySplineSegment segment = null;
			//while (!isOpen)
			//{
			//	int random = Random.Range(0, connection.Count);
			//	segment = connection[random];
			//	string splineName = segment.Spline.name;
			//	isOpen = CityAIUtils.CheckSplineIsOpen(splineName);
			//}
			int random = Random.Range(0, connection.Count);
			segment = connection[random];
			if (segment == null) segment = connection[0];
			return segment;
		}

		
    }
}

